/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import request from '@/utils/request';

// 获取驿站列表
export async function getYzList(params) {
  return request('/Api/YZ/CourierStation/getSubDaksList', {
    method: 'POST',
    body: params,
  });
}

// 创建报表任务
export async function getExportTask(params) {
  return request('/Api/YZ/StockManage/createExportTask', {
    method: 'POST',
    body: params,
  });
}

// 区域排名，创建报表任务
export async function getAreaExportTask(params) {
  return request('/Api/YZ/ExcelTask/createRankExportTask', {
    method: 'POST',
    body: params,
  });
}

// 导出报表任务
export async function getReport(params) {
  return request('/Api/YZ/StockManage/exportTaskList', {
    method: 'POST',
    body: params,
  });
}

// 数据统计报表导出
export async function asyncExport(params) {
  return request('/Api/YZ/ExcelTask/create', {
    method: 'POST',
    body: params,
  });
}
// 数据统计，重新生成报表
export async function regeneration(params) {
  return request('/Api/YZ/StockManage/retryExport', {
    method: 'POST',
    body: params,
  });
}
// 数据统计，获取报表下载类型
export async function getReportListType(params = {}) {
  if (!params.type) return [];
  return request('/v1/ReportDownload/getReportOptions', {
    method: 'POST',
    body: params,
  }).then(res => {
    if (res.code == 0) {
      return res.data;
    }
    return [];
  });
}
// 数据统计，获取报表下载分类
export async function getReportType(params) {
  return request('/v1/ReportDownload/getClassifyOptions', {
    method: 'POST',
    body: params,
  }).then(res => {
    if (res.code == 0) {
      return res.data;
    }
    return [];
  });
}
